<%-- 
    Document   : add_category
    Created on : Apr 30, 2011, 6:20:45 AM
    Author     : stolworthyfamily
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jspf/tagImports.jspf" %>
<!DOCTYPE html>

<html:html lang="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>
      Add Category
    </title>
    <html:base/>
  </head>
  <tags:adminMenu />

  <div id="content">
    <tags:body>
    <h1>Item Category - Administration</h1>
      <table>
        <tr>
          <td width="404" valign="top">
            <c:url var="saveUrl1" value="/admin/addItemCategory.do">
              <c:param name="sub" value="true" />
            </c:url>
            <form action="${saveUrl1}" method="post">

              <table cellspacing="5" border="0">
                <tr>
                  <td align="right">Category Name: </td>
                  <td><input type="text" name="name" id="name"></td>
                </tr>
                <tr>
                  <td align="right">Label Color: </td>
                  <td><input type="text" name="labelColor" id="labelColor"></td>
                </tr>
                <tr>
                  <td align="right">Image Location: </td>
                  <td>
                    <input type="text" name="imageLocation" id="imageLocation">
                  </td>
                </tr>
                <tr>
                  <td>
                    <input type="submit" id="sub" name="sub" value="Add Category" />
                  </td>
                </tr>
              </table>
            </form>
          </td>
        </tr>
      </table>
      <h2>Categories:</h2>
      <table style="border-style: solid;">
        <tr style="border-style: inherit;">
          <th>Name</th>
          <th>Color</th>
          <th>Action</th>
        </tr>
        <c:forEach var="category" items="${categories}" >
          <tr>
            <td><c:out value="${category.name}" /></td>
            <td style="background-color: ${category.labelColor};"><c:out value="${category.labelColor}" /></td>
            <td> <c:url var="deleteCategory" value="/admin/addItemCategory.do">
                <c:param name="categoryID" value="${category.itemCategoryID}" />
              </c:url>
              <a href="${deleteCategory}">
                Delete Item Category
              </a>
            </td>
          </tr>
        </c:forEach>
      </table>

    </tags:body>
  </div>
  <div id = "footer">
    <span>
      &nbsp;All rights reserved Garage Sale 2011 | Legal | Privacy Policy
    </span>
    <br><br>
    <img alt="" src="../../images/b1.gif">
    <img alt="" src="../../images/b2.gif" style="margin:0px 5px 0px 5px">
    <img alt="" src="../../images/b3.gif">
  </div>


</html:html> 
